class Student:
    def __init__(self,name,Chinese,math,English):
        self.name = name
        self.Chinese = int(Chinese)
        self.math = int(math)
        self.English = int(English)
    
    def total_scores(self):
        return int(self.Chinese + self.math + self.English)
    

    
num = int(input())
group = []
grade = []
for i in range(num):
    ls = list(map(str,input().split()))
    group.append(ls)
for j in group:
    name,Chinese,math,English = j
    student = Student(name,Chinese,math,English)
    scores = student.total_scores()
    grade.append(scores)
max_scores = max(grade)
max_index = grade.index(max_scores)

for x in group[max_index]:
    print(x,end=' ')

